package org.example.finaspringboot.mapper;



import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.example.finaspringboot.entity.Blog;

import java.util.List;

@Mapper
public interface BlogMapper {
    @Select("select * from blog ORDER BY created_at DESC ")
    List<Blog> selectAll();
    @Select("select count(*) from blog")
    int countBlogs();
    @Select("select * from blog ORDER BY create_at DESC LIMIT #{limit} OFFSET #{offset}")
    List<Blog> findBlogsByPage(int offset, int limit);
}
